import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WecomLeadsVO, WecomLeadsForm, WecomLeadsQuery } from '@/api/bus/wecomLeads/types';

/**
 * 查询留资管理列表
 * @param query
 * @returns {*}
 */

export const listWecomLeads = (query?: WecomLeadsQuery): AxiosPromise<WecomLeadsVO[]> => {
  return request({
    url: '/bus/wecomLeads/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询留资管理详细
 * @param id
 */
export const getWecomLeads = (id: string | number): AxiosPromise<WecomLeadsVO> => {
  return request({
    url: '/bus/wecomLeads/' + id,
    method: 'get'
  });
};

/**
 * 新增留资管理
 * @param data
 */
export const addWecomLeads = (data: WecomLeadsForm) => {
  return request({
    url: '/bus/wecomLeads',
    method: 'post',
    data: data
  });
};

/**
 * 修改留资管理
 * @param data
 */
export const updateWecomLeads = (data: WecomLeadsForm) => {
  return request({
    url: '/bus/wecomLeads',
    method: 'put',
    data: data
  });
};

/**
 * 删除留资管理
 * @param id
 */
export const delWecomLeads = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bus/wecomLeads/' + id,
    method: 'delete'
  });
};
